//
//  HHomeViewController.m
//  HTanzhi
//
//  Created by 陈贵 on 15/10/28.
//  Copyright © 2015年 hzj. All rights reserved.
//

#import "HHomeViewController.h"
#import "HNavigationController.h"
#import "HUserSet.h"
#import "MJExtension.h"
#import "HUserSetData.h"
#import "HAccontView.h"
#import "HScanView.h"


@interface HHomeViewController ()
@property (nonatomic,strong)UILabel *myLable;

@end

@implementation HHomeViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:24],NSForegroundColorAttributeName:[UIColor whiteColor]};
    //收索按钮
    [self addTheSearchBth];
    //用户中心
    [self addTheAccountBth];
    
}

#pragma searchBth
/// 添加收索按钮
- (void)addTheSearchBth{
    UIBarButtonItem *searBt = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"btnSearch"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]  style:UIBarButtonItemStylePlain target:self action:@selector(clickTheSearchBth)];
    self.navigationItem.rightBarButtonItem = searBt;
}
/// 点击收索按钮
- (void)clickTheSearchBth{
    
    UIViewController *search = [[UIViewController alloc]init];
    search.view.backgroundColor = [UIColor whiteColor];
    UISearchBar *bar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 10, 100)];
    bar.placeholder = @"收索: 关键字";
    search.navigationItem.titleView = bar;
    [self.navigationController pushViewController:search animated:YES];
}

#pragma account
///添加用户中心按钮
- (void)addTheAccountBth{
    UIBarButtonItem *accountBth = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"btnPersonCenter"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]  style:UIBarButtonItemStylePlain target:self action:@selector(clickTheAccountBth)];
    self.navigationItem.leftBarButtonItem = accountBth;
}
///点击用户按钮
- (void)clickTheAccountBth{
    /*
    HUserSet *account = [[HUserSet alloc]initWithStyle:UITableViewStyleGrouped];
    account.navigationItem.title = @"个人中心";
    account.userData = [HUserSetData objectArrayWithFilename:@"accountData.plist"];
    [self.navigationController pushViewController:account animated:YES];
    NSLog(@"123");
    */
    
    HAccontView *hv = [[HAccontView alloc]init];
    hv.userSetData = [HUserSetData objectArrayWithFilename:@"accountData.plist"];
    hv.title = @"个人中心";
    [self.navigationController pushViewController:hv animated:YES];
    
    
}


@end
